//
//  Plant+FirstLetter.m
//  PlotMate
//
//  Created by Brian Boyle on 27/03/2012.
//  Copyright (c) 2012 Brian Boyle. All rights reserved.
//

#import "Plant+FirstLetter.h"

@implementation Plant (FirstLetter)

/*Get the first letter of the name of a plant as uppercase*/
-(NSString *)uppercaseFirstLetterOfName
{
    [self willAccessValueForKey:@"uppercaseFirstLetterOfName"];
    NSString *nameString = [[self valueForKey:@"name"] uppercaseString];
    
    NSString *firstLetter = [nameString substringWithRange:[nameString rangeOfComposedCharacterSequenceAtIndex:0]];
    [self didAccessValueForKey:@"uppercaseFirstLetterOfName"];
    return firstLetter;
}
@end
